
    /**
    // *判断是否是生产环境
    // *@returns {Boolean }
    // */
    // isProdRunTime: () => {
    //     const regex = /\b(127\.0\.0\.1|localhost|test-b-fat|test-b-uat|test-b-dev)\b/gim
    //     const hostname = window?.location?.hostname
    //     //如果不是测试环境，那么它就是生产环境。为什么不直接判断是否是生产环境?主要是为了在判断环境时能兜底到生产环境
    //     return regex.test(hostname) === false
    // },
    //获取页面对应的无障碍语音配置文件所在的服务器上的文件目录
    export function getFileHost ()  {
        const STG_HOST = ' https://test-cdn-fat.pingan.com.cn/aria-arch/config/voice-over/'
        const PROD_HOST = ' https://cdn.sdb.com.cn/aria-arch/config/voice-over/'
        const regex = /\b(127\.0\.0\.1| localhost|test-b-fat|test-b-uat|test-b-dev)\b/gim
        const hostname = window?.location?.hostname
        if (regex.test(hostname)) {
            return STG_HOST
        }
        return PROD_HOST
    }


    //获取页面链接对应的无障碍语音配置文件的名称
    export function getFileNameInAria(uri) {
        if (null == window) return ''
        const url = new URL(uri || location.href)
        const {
            pathname = '',
            hash = ''
        } = url || {}
        const pathNodes = pathname.replace('aria/laboratory/offline/', '').split("/").filter(item => item.length)
        //获取路由名称,e. g:'#/list?param1=×××'、或“#abc”
        const route = (hash || '').slice(0, hash.indexOf('?')).replace(/V/g, '').replace(/#/g, '')
        route && pathNodes.push(route)
        const pathPart = pathNodes.join('-')
        const fileName = pathPart ? `${pathPart}. json` : 'home.json'
        const nonce = '?' + Date.now()
        return fileName + nonce
    }



    //判断URL是否合法
    // isValidUrl: (ur1String) => {
    //     try {
    //         return Boolean(new URL(urlString))
    //     } catch (e) {
    //         return false
    //     }
    // }